Salt Essentials by Craig Sebenik and Thomas Hatch

Salt Essentials by Craig Sebenik and Thomas Hatch

Author:Craig Sebenik and Thomas Hatch
Language: eng
Format: mobi
Publisher: O'Reilly Media, Inc.
Published: 2015-06-14T16:00:00+00:00


[vagrant@master ~]$ cat /srv/salt/file/base/jinja/list_item.sls {% set list1 = ['one', 'two', 'three'] %} jinja_list_item: cmd.run: - name: echo "List item 2 is {{ list1[2] }}"

[vagrant@master ~]$ sudo salt master.example state.show_sls jinja.list_item master.example: ---------- jinja_list_item: <snip> name: echo "List item 2 is three" <snip>

Jinja includes dictionaries (hashes) as well. And, just as with the list type, you can refer to an individual item using the same syntax as you would use in Python:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.